package com.haruhi.bot.mapper.postgresql;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.haruhi.bot.entity.bot.PixPicture;
import com.haruhi.bot.entity.dto.PixPictureCondition;
import com.haruhi.bot.entity.vo.RepeatMD5;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
@DS("postgreql")
public interface PixPictureMapper {

    List<PixPicture> selectList();

    int insertPiXPicture(PixPicture picture);

    Integer countByImageP(String md5);

    Integer countByImageUrl(String url);

    int insertBatch(@Param("list") List<PixPicture> list);

    /**
     * 分组查询md5重复的图片
     * @return
     */
    List<PixPicture> selectRepeatPicture();

    int deleteByIds(@Param("list") List<PixPicture> list);

    int deleteByImgP(@Param("list") List<PixPicture> pixPictures);

    List<PixPicture> select(@Param("condition") PixPictureCondition condition);
}
